import request from '@/utils/request'

//登录
export function login(data) {
  return request({
    url: 'api/user/login.do',
    method: 'post',
    data
  })
}
//新增
export function add(data) {
  return request({
    url: 'api/user/save.do',
    method: 'post',
    data
  })
}
//修改
export function update(data) {
  return request({
    url: 'api/user/update.do',
    method: 'post',
    data
  })
}
//查询
export function all(data) {
  return request({
    url: 'api/user/all.do',
    method: 'get',
    params:data
  })
}
export function getInfo(token) {
  return request({
    url: 'api/user/single.do?id='+token,
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}
